import asyncio
import time

def get_data():
    asyncio.sleep(3)
    return 1
async def f1(i):
    print('f1 start')
    resu = await get_data()
    print('f1 end', resu)





# 创建协程对象
task1 = f1(1)

start = time.time()
# 使用gather()方法运行协程任务
loop = asyncio.get_event_loop()
loop.run_until_complete(asyncio.gather(task1))
print(start-time.time())